package com.vivo.util;

import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.List;

import javax.faces.model.SelectItem;
import javax.faces.model.SelectItemGroup;

import com.cdm.persistence.ContentType;
import com.vivo.exception.DToolCheckException;

/**
 * File: FrailsHelper.java
 * <P>
 * Description: -none-
 * <P>
 * <B>Change History :</B>
 * <P>
 * <ul>
 * <li>2008-3-10 Created by vivo</li>
 * </ul>
 * 
 * @author GaoBo
 */
public class FrailsHelper {
	
	public static <T> SelectItemGroup putInSelectItemGroup(List<T> list, Method method) {
		try{
//			Type supType = getClass().getGenericSuperclass();
//			ParameterizedType paramType = (ParameterizedType) supType;
//			entityClass = (Class<T>) paramType.getActualTypeArguments()[0];
//			Method = 
		}catch(RuntimeException ex){
			
		}
		
		int size = list.size();
		SelectItem[] items = new SelectItem[size];
		for (int i = 0; i < size; i++) {
			T type = list.get(i);
//			items[i] = new SelectItem(type, type.getName());
		}
		SelectItemGroup group = new SelectItemGroup();
		group.setSelectItems(items);
		return group;

	}
}
